luci-mod-network: add gui options for netifd source and destination port
authorErik Conijn <[email protected]>
Thu, 29 May 2025 10:21:00 +0000 (12:21 +0200)
committerPaul Donald <[email protected]>
Sun, 8 Jun 2025 14:26:16 +0000 (17:26 +0300)
Maintainer: @systemcrash
Compile tested: aarch64, cortex-a53, OpenWRT Main
Run tested: Dynalink DL-WRX36

Recently for netifd source and destination port have been added see https://github.com/openwrt/netifd/commit/7901e66c5f273bceee8981bc8a0c8b0e60945f60

This PR adds the GUI options for netifd source and destination port.

Signed-off-by: Erik Conijn <[email protected]>
modules/luci-mod-network/htdocs/luci-static/resources/view/network/routes.js

index 312b53007accb1fbbbfe59c76a1ef47e0642f0d3..afc02b33ba1089507adf0b590dae22ba1d4e6fd6 100644 (file)
@@ -195,6 +195,16 @@ return view.extend({
                        o.datatype = 'string';
                        o.placeholder = '0x1/0xf';
 
+                       o = s.taboption('advanced', form.Value, 'sport', _('Source port'), _('Match traffic from this source port (range)'));
+                       o.modalonly = true;
+                       o.datatype = 'portrange';
+                       o.placeholder = '0-65535';
+
+                       o = s.taboption('advanced', form.Value, 'dport', _('Destination port'), _('Match traffic from this destination port (range)'));
+                       o.modalonly = true;
+                       o.datatype = 'portrange';
+                       o.placeholder = '0-65535';
+
                        o = s.taboption('advanced', form.Value, 'tos', _('Type of service'), _('Specifies the TOS value to match in IP headers'));
                        o.modalonly = true;
                        o.datatype = 'uinteger';